package com.xywh.emergency_outbound.mvp.api;


import com.xywh.emergency_outbound.mvp.ui.entity.AddressAdd;
import com.xywh.emergency_outbound.mvp.ui.entity.AddressAddJson;
import com.xywh.emergency_outbound.mvp.ui.entity.AddressDelete;
import com.xywh.emergency_outbound.mvp.ui.entity.AddressEdit;
import com.xywh.emergency_outbound.mvp.ui.entity.CancelReceipt;
import com.xywh.emergency_outbound.mvp.ui.entity.ConfirmReceipt;
import com.xywh.emergency_outbound.mvp.ui.entity.Login;
import com.xywh.emergency_outbound.mvp.ui.entity.OrderList;
import com.xywh.emergency_outbound.mvp.ui.entity.OrderReleased;
import com.xywh.emergency_outbound.mvp.ui.entity.OrderSuccess;
import com.xywh.emergency_outbound.mvp.ui.entity.Setting;
import com.xywh.emergency_outbound.mvp.ui.entity.Tab1;
import com.xywh.emergency_outbound.mvp.ui.entity.Tab1Address;
import com.xywh.emergency_outbound.mvp.ui.entity.Tab2;
import com.xywh.emergency_outbound.mvp.ui.entity.Tab4;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface ApiService {

    /**
     * 登录
     *
     * @param map
     * @return
     */
    @GET("account/get")
    Observable<Login> getLoginData(@QueryMap Map<String, String> map);

    /**
     * 地址列表
     *
     * @param map
     * @return
     */
    @GET("Consignee/get")
    Observable<Tab4> getTab4Data(@QueryMap Map<String, String> map);

    /**
     * 添加地址  废弃不用
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("Consignee/add")
    Observable<AddressAdd> getAddressAddData(@FieldMap Map<String, String> map);

    /**
     * 添加地址
     *
     * @param info
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("Consignee/add")
    Observable<AddressAddJson> getAddressAddJsonData(@Body RequestBody info);

    /**
     * 删除地址
     *
     * @param addressId
     * @return
     */
    @GET("Consignee/delete")
    Observable<AddressDelete> deleteAddressData(@Query("pid") String addressId);

    /**
     * 修改地址
     *
     * @param info
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("Consignee/modify")
    Observable<AddressEdit> getAddressEditData(@Body RequestBody info);

    /**
     * 首页获取物料列表
     *
     * @param map
     * @return
     */
    @GET("material/get")
    Observable<Tab1> getTab1Data(@QueryMap Map<String, String> map);

    /**
     * 首页获取 融合区地址
     *
     * @param map
     * @return
     */
    @GET("address/get")
    Observable<Tab1Address> getTab1Address(@QueryMap Map<String, String> map);

    @GET("EmgTransfer/get")
    Observable<Tab2> getTab2Data(@QueryMap Map<String, String> map);

    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("EmgTransfer/add")
    Observable<OrderSuccess> getTab3Data(@Body RequestBody info);

    Observable<Setting> getSettingData(Map<String, String> map);

    Observable<OrderList> getOrderListList(Map<String, String> map);

    @GET("EmgTransfer/Confirm")
    Observable<ConfirmReceipt> confirmReceipt(@QueryMap Map<String, String> map);

    @GET("EmgTransfer/Cancel")
    Observable<CancelReceipt> cancelReceipt(@QueryMap Map<String, String> map);

    Observable<OrderReleased> getOrderReleasedData(Map<String, String> map);
}
